<template>
	<view class="container">
		<view class="list bg-white pad-26 mar-top-20">
			<view class="font-28 mar-top-30 mar-top-20">
				<view class="text-center">总资产（元）</view>
				<view class="text-center mar-top-30 font-w-600 font-80">{{kftInfo.balance}}</view>
				
				<view class="centerY mar-bottom-10 mar-top-100 text-center">
					<view class="flex-w">可提现金额:{{kftInfo.maxWithdrawableBalance}}元</view>
					<view class="flex-w">冻结金额:{{kftInfo.freezeAmount}}元</view>
				</view>
			</view>
		</view>
		
		<view class="pad-26 bg-white mar-top-20" @click="hanldeCardRun">
			<view class="font-28 centerY betweenX">
				<view>银行卡</view>
				<view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
		</view>
		
		<view class="pad-26 bg-white mar-top-20" @click="hanldeWithdrawal">
			<view class="font-28 centerY betweenX">
				<view>提现</view>
				<view>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		userWalletInfo,
	} from '@/config/api.js'
	export default {
		data() {
			return {
				kftInfo: {}
			}
		},
		onShow() {
			this.getDataInfo();
		},
		methods: {
			// 添加银行卡
			hanldeCardRun(){
				uni.navigateTo({
					url: '/pages/kft/cardRun'
				})
			},
			// 钱包详情
			getDataInfo() {
				userWalletInfo({
					plat_id: 13
				}).then(res => {
					this.kftInfo = res.data.info.kft;
				})
			},
			// 提现
			hanldeWithdrawal(){
				uni.navigateTo({
					url: '/pages/kft/userApply'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {
		background: #f5f5f5;
		min-height: 100vh;
	
		.withdrawal {
			background: #3c9cff;
		}
	
		.popup-box {
			width: 490rpx;
		}
	
		.recharge {
			background: #5ac725;
		}
	}
</style>